package com.ttloner.admin.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author TTLoner
 * @date 2021/7/25 14:50
 * @description
 */
@Configuration
public class MyBatisPlusConfig {

    //mybatisplus分页插件
    @Bean
   public PaginationInterceptor paginationInterceptor(){
       PaginationInterceptor interceptor = new PaginationInterceptor();
       interceptor.setCountSqlParser(new JsqlParserCountOptimize(true));
       interceptor.setOverflow(true);
       interceptor.setLimit(500L);
       return interceptor;
   }
}
